// service

// const environments = 'prod'  
const environments = `${process.env.NODE_ADDR}` || 'prod'
const devHost = 'http://192.168.0.194'
// const devHost = 'http://192.168.0.192:6001'
// const devHost = 'https://zhny.hn.sgcc.com.cn'
const testHost = "http://192.168.0.194"
const test1Host = 'http://192.168.0.193'
const ttestHost = 'http://192.168.0.194'
// const prodHost = 'https://172.31.192.209:80'
const prodHost = 'https://zhny.hn.sgcc.com.cn'
// const testHost = 'http://192.168.8.12'

const apisPath = {
  informationBase: {
    dev: {

    },
    test: {
      url: `${testHost}:9005`
    },
    prod: {
      url: `${prodHost}`
      // url: `${prodHost}:20001`
    }
  },
  operationmanagement: {

    dev: {
     
    },
    test: {
      url: `${testHost}:9001`
    },
    prod: {
      url: `${prodHost}`
      // url: `${prodHost}:20002`
    }
  },
  panoramahall: {

    dev: {

    },
    test: {
      url: `${testHost}:8887`
    },
    prod: {

      url: `${prodHost}`
      // url: `${prodHost}:20003`
    }
  },
  profile: {
    dev: {

    },
    test: {
      url: `${testHost}:8888`
    },
    prod: {
      url: `${prodHost}`
      // url: `${prodHost}:20004`
    }
  },
  realtimemonitor: {
    dev: {

    },
    test: {
      url: `${testHost}:8889`
    },
    prod: {
      url: `${prodHost}`
      // url: `${prodHost}:20005`
    }
  },

  substationoperation: {
    dev: {

    },
    test: {
      url: `${ttestHost}:9002`
    },
    prod: {
      url: `${prodHost}`
      // url: `${prodHost}:20006`
    }
  },
  utiltools: {
    dev: {
    },
    test: {
      url: `${test1Host}:8885`
    },
    prod: {
      url: `${prodHost}`
      // url: `${prodHost}:20021`
    }
  },
  systemmanagement: {
    dev: {
    },
    test: {
      url: `${testHost}:9004`
    },
    prod: {
      url: `${prodHost}`
      // url: `${prodHost}:20021`
    }
  },
  sys: {

    test: {
      url: `${testHost}:9006`
    },
    prod: {

      url: `${prodHost}`
      // url: `${prodHost}:20020`
    }
  }
}

const renderUrl = url => {
  return (apisPath[url] && apisPath[url][environments] ? apisPath[url][environments] : { url: '' }).url
}

export {
  renderUrl
}
